// DbusSignals.java
package v2;

import org.freedesktop.dbus.exceptions.DBusException;
import org.freedesktop.dbus.messages.DBusSignal;
import org.freedesktop.dbus.types.Variant;

import java.util.Map;

/**
 * D-Bus 信号定义类 (dbus-java 3.3.2)
 */
public class DbusSignals {

    // PropertiesChanged 信号
    public static class PropertiesChanged extends DBusSignal {
        public final String interfaceName;
        public final Map<String, Variant<?>> changedProperties;
        public final String[] invalidatedProperties;

        public PropertiesChanged(String path, String interfaceName,
                                 Map<String, Variant<?>> changedProperties,
                                 String[] invalidatedProperties) throws DBusException {
            super(path, interfaceName, changedProperties, invalidatedProperties);
            this.interfaceName = interfaceName;
            this.changedProperties = changedProperties;
            this.invalidatedProperties = invalidatedProperties;
        }
    }

    // InterfacesAdded 信号
    public static class InterfacesAdded extends DBusSignal {
        public final String objectPath;
        public final Map<String, Map<String, Variant<?>>> interfaces;

        public InterfacesAdded(String path, Map<String, Map<String, Variant<?>>> interfaces)
                throws DBusException {
            super(path, interfaces);
            this.objectPath = path;
            this.interfaces = interfaces;
        }
    }

    // InterfacesRemoved 信号
    public static class InterfacesRemoved extends DBusSignal {
        public final String objectPath;
        public final String[] interfaces;

        public InterfacesRemoved(String path, String[] interfaces) throws DBusException {
            super(path, interfaces);
            this.objectPath = path;
            this.interfaces = interfaces;
        }
    }

    // 自定义蓝牙数据信号
    public static class CustomBluetoothSignal extends DBusSignal {
        public final String data;

        public CustomBluetoothSignal(String path, String data) throws DBusException {
            super(path, data);
            this.data = data;
        }
    }


}